package com.design.homework.hw0317.observer.gperadvice.v2;

import com.design.homework.hw0317.observer.gperadvice.v2.question.GPerEntertainmentQuestion;
import com.design.homework.hw0317.observer.gperadvice.v2.question.GPerStudyQuestion;
import com.design.homework.hw0317.observer.gperadvice.v2.subscribes.GPerEntertainmentSubscribes;
import com.design.homework.hw0317.observer.gperadvice.v2.subscribes.GPerStudySubscribes;
import com.design.homework.hw0317.observer.gperadvice.v2.user.EntertainmentTeacher;
import com.design.homework.hw0317.observer.gperadvice.v2.user.StudyTeacher;
import com.google.common.eventbus.EventBus;


/**
 * @author qiqiang.ren
 * @since 2019/3/20
 */
public class GPerGuavaEventTest {

    public static void main(String[] args) {
        //消息总线
        EventBus gper = new EventBus();
        GPerStudySubscribes studySubscribes = new GPerStudySubscribes();
        gper.register(studySubscribes);
        gper.post(new GPerStudyQuestion("riseSun", "tom老师! 我在学习设计模式，您有什么更好的建议吗？", new EntertainmentTeacher("tom", 18, 1)));

        GPerEntertainmentSubscribes entertainmentSubscribes = new GPerEntertainmentSubscribes();
        gper.register(entertainmentSubscribes);
        gper.post(new GPerEntertainmentQuestion("riseSun", "james老师！您有关于在杭州租房好的建议吗？",new StudyTeacher("james", 25, 1)));

        entertainmentSubscribes = new GPerEntertainmentSubscribes();
        gper.register(entertainmentSubscribes);
        gper.post(new GPerEntertainmentQuestion("riseSun", "james老师！您有关于在杭州租房好的建议吗？",new EntertainmentTeacher("james", 25, 1)));

    }
}
